######################################################################
#Replication file for "The Impact of China's AIIB on the World Bank"
#Authors: Jing Qian, James Vreeland, Jianzhi Zhao
#Codes to replicate Figure F.3
######################################################################
rm(list = ls())

#Other packages used
library(panelView)

#Setwd
setwd("C:/Users/qianj/Dropbox (Princeton)/AIIB_WB_Replication")

#Load data
load("data/data_main.RData")

###################################
#Produce Figure F3
###################################
#Setup
png(filename = "figure/Figure_F3.png",
    height = 800,
    width = 1200)

#Plot
panelView(hard_project_count_all ~ aiib_founder_2016 + 
            gdppc_log_lag + population_log_lag + election_either_lag + 
            fdi_gdp_lag + debt_gni_lag + oda_gni_lag + polity2_lag + unsc_lag + IdealPointDistance_lag,
          data = df.main,
          index = c("iso2c", "year"),
          xlab = "",
          cex.main = 20,
          cex.axis = 12,
          cex.lab = 15,
          cex.legend = 16,
          background = "white") + 
  theme(axis.title.y = element_blank(),
        axis.text.y = element_blank(),
        axis.ticks.y = element_blank())

#Close
dev.off()